﻿#pragma once
#include <string>
#include "BoneWeight.h"

namespace DYGraphics
{
	struct _declspec(dllexport) Vertex
	{
		float position[3];
		float normal[3];
		float tangent[3];
		float texcoord[2];
	};

	struct _declspec(dllexport) MeshData
	{
		std::string name;
		Vertex* vertices;
		unsigned int* indices;
		BoneWeight* boneWeights;
		int vertexCnt;
		int indiceCnt;

		void Destroy()
		{
			if (vertices != nullptr)
			{
				delete[] vertices;
				vertices = nullptr;
			}

			if (indices != nullptr)
			{
				delete[] indices;
				indices = nullptr;
			}

			if (boneWeights != nullptr)
			{
				delete[] boneWeights;
				boneWeights = nullptr;
			}
		}
	};
}